/**
 * 
 */
package com.swim.traininfo.entity;

import java.util.ArrayList;
import java.util.List;

import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 培训资讯Entity
 * @author 刘军武
 * @version 2021-04-25
 */
@Table(name="t_train_info", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一标识", isPK=true),
		@Column(name="type", attrName="type", label="类型 1表示游泳馆风采 2表示行业资讯"),
		@Column(name="natatorium_info_id", attrName="natatoriumInfoId", label="游泳馆信息id"),
		@Column(name="title", attrName="title", label="标题", queryType=QueryType.LIKE),
		@Column(name="content", attrName="content", label="内容"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class TrainInfo extends DataEntity<TrainInfo> {
	
	private static final long serialVersionUID = 1L;
	private Integer type;		// 类型 1表示游泳馆风采 2表示游泳教学
	private String natatoriumInfoId;		// 游泳馆信息id
	private String title;		// 标题
	private String content;		// 内容
	
	//################## 附加字段 #######################
	private List<String> trainInfoImageUrlList = new ArrayList<String>();	// 培训资讯图片url集合
	
	public TrainInfo() {
		this(null);
	}

	public TrainInfo(String id){
		super(id);
	}
	
	public List<String> getTrainInfoImageUrlList() {
		return trainInfoImageUrlList;
	}

	public void setTrainInfoImageUrlList(List<String> trainInfoImageUrlList) {
		this.trainInfoImageUrlList = trainInfoImageUrlList;
	}

	@NotNull(message="类型不能为空")
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}
	
	public String getNatatoriumInfoId() {
		return natatoriumInfoId;
	}

	public void setNatatoriumInfoId(String natatoriumInfoId) {
		this.natatoriumInfoId = natatoriumInfoId;
	}

	@NotBlank(message="标题不能为空")
	@Length(min=0, max=100, message="标题长度不能超过 100 个字符")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
}